﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Water.Architecture2.EntityXML
{
    internal class PropertyNode
    {
        /*
          name 
          column
          type
          generator-type
          generator-name
          insert-ignore
          update-ignore
          ref-entity
          ref-property
          ref-mode
          ref-display-property
          property
          prompt
         */
        private string name;

        internal string Name
        {
            get { return name; }
            set { name = value; }
        }
        private string column;

        internal string Column
        {
            get { return column; }
            set { column = value; }
        }
        private string type;

        internal string Type
        {
            get { return type; }
            set { type = value; }
        }
        private GeneratorType generatorType = GeneratorType.None;

        internal GeneratorType GeneratorType
        {
            get { return generatorType; }
            set { generatorType = value; }
        }
        private string generatorName;

        internal string GeneratorName
        {
            get { return generatorName; }
            set { generatorName = value; }
        }
        private bool insertIgnore;

        internal bool InsertIgnore
        {
            get
            {
                if (this.generatorType == GeneratorType.Indentity || this.generatorType == GeneratorType.Sequence || this.nodeType == PropertyNodeType.RefProperty)
                    this.insertIgnore = true;
                return insertIgnore;
            }
            set { insertIgnore = value; }
        }
        private bool updateIgnore;

        internal bool UpdateIgnore
        {
            get
            {
                if (this.nodeType == PropertyNodeType.RefProperty)
                    this.updateIgnore = true;
                return updateIgnore;
            }
            set { updateIgnore = value; }
        }
        private string refEntity;

        internal string RefEntity
        {
            get { return refEntity; }
            set { refEntity = value; }
        }
        private string refProperty;

        internal string RefProperty
        {
            get { return refProperty; }
            set { refProperty = value; }
        }
        private string property;

        internal string Property
        {
            get { return property; }
            set { property = value; }
        }
        private string refDisplayProperty;

        internal string RefDisplayProperty
        {
            get { return refDisplayProperty; }
            set { refDisplayProperty = value; }
        }

        private RefMode refMode;

        internal RefMode RefMode
        {
            get { return refMode; }
            set { refMode = value; }
        }


        private PropertyNodeType nodeType;

        internal PropertyNodeType NodeType
        {
            get { return nodeType; }
            set { nodeType = value; }
        }

        private string prompt;

        internal string Prompt
        {
            get { return prompt; }
            set { prompt = value; }
        }
    }
}
